package com.ruoyi.project.in.stockindetail.service;


import com.ruoyi.common.core.text.Convert;
import com.ruoyi.project.bas.productMap.domain.ProductMap;
import com.ruoyi.project.bas.productMap.mapper.ProductMapMapper;
import com.ruoyi.project.in.stockindetail.domain.StockinDetail;
import com.ruoyi.project.in.stockindetail.mapper.StockinDetailMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 入库单子管理 服务层实现
 * 
 * @author sys
 * @date 2021-10-28
 */
@Service
public class StockinDetailServiceImpl implements IStockinDetailService 
{
	@Autowired
	private StockinDetailMapper stockinDetailMapper;
	@Autowired
	private ProductMapMapper productMapMapper;
	/**
     * 查询入库单子管理列表
     * 
     * @param stockinDetail 入库单子管理信息
     * @return 入库单子管理集合
     */
	@Override
	public List<StockinDetail> selectStockinDetailList(StockinDetail stockinDetail)
	{
		List<StockinDetail> list = null;
//		ProductMap productMap = productMapMapper.selectProductMapByDetail(stockinDetail.getProductId());
//		if(productMap!=null){
//			stockinDetail.setProductId(productMap.getProductId());
			list = stockinDetailMapper.selectStockinDetailList(stockinDetail);
			if (list.size() == 0){
				list = stockinDetailMapper.selectStockinDetailListFinish(stockinDetail.getStockinGuid());
			}
//		}
//

	    return list;

	}
	

}
